<template>
	<view class="indexs">
		<view class="header header_lan" :style="'padding-top: ' + navH + 'px;'">
			<view class="header_height" :style="
          'height:' +
          gaodu +
          'px;line-height:' +
          gaodu +
          'px;top:' +
          gaodutops +
          'px;'
        ">
				<view class="index_h_cont3">
					<view class="index_wenben_img" @tap="jumpzuo">
						<image :src="imgUrl + '/dzx_img22.png'" mode="widthFix"></image>
					</view>
					<view class="index_wenben baise">{{
            $t("page_my_xinshouxiadan.Novice_order_process")
          }}</view>
				</view>
			</view>
			<view class="coloe_title">s</view>
		</view>
		<view class="index_center" :style="'padding-top:' + (navH + 50) + 'px;'">
			<view class="my_xinshouxiadan_center">
				<view class="my_xinshouxiadan_list">
					<view class="my_xinshouxiadan_cont">
						<view class="my_xinshouxiadan_title">
							<image :src="imgUrl + '/dzx_img168.png'"></image>
							<text>{{ newuserprocess.first_title }}</text>
						</view>
						<view class="my_xinshouxiadan_txt">{{ newuserprocess.first_remark }}</view>
						<view class="my_xinshouxiadan_wenben" v-for="(item, index) in cangkulist">
							<view class="my_xinshouxiadan_wenben_dis">
								<view class="my_xinshouxiadan_wenben_t1">{{
                  item.shop_name
                }}</view>
								<view class="my_xinshouxiadan_wenben_t2" :data-id="index" @tap="fuzhi">
									{{ $t("page_my_xinshouxiadan.one_click_copy") }}
								</view>
							</view>
							<view class="my_xinshouxiadan_wenben_t3">{{ item.linkman }}</view>
							<view class="my_xinshouxiadan_wenben_t3">{{ item.phone }}</view>
							<view class="my_xinshouxiadan_wenben_t3" style="margin-top: 14rpx">
								{{ item.region.province }}{{ item.region.city
                }}{{ item.region.region }}{{ item.address }}
							</view>
						</view>
					</view>
					<view class="my_xinshouxiadan_cont">
						<view class="my_xinshouxiadan_title">
							<image :src="imgUrl + '/dzx_img170.png'"></image>
							<text>{{ newuserprocess.second_title }}</text>
						</view>
						<view class="my_xinshouxiadan_txt">{{ newuserprocess.second_remark }}</view>
						<view class="my_xinshouxiadan_btns" @tap="tiaozhuans">{{ newuserprocess.second_anniu }}</view>
					</view>
					<view class="my_xinshouxiadan_cont">
						<view class="my_xinshouxiadan_title">
							<image :src="imgUrl + '/dzx_img170.png'"></image>
							<text>{{ newuserprocess.third_title }}</text>
						</view>
						<view class="my_xinshouxiadan_txt">{{ newuserprocess.third_remark }}</view>
					</view>
					<view class="my_xinshouxiadan_cont">
						<view class="my_xinshouxiadan_title">
							<image :src="imgUrl + '/dzx_img171.png'"></image>
							<text>{{ newuserprocess.fourth_title }}</text>
						</view>
						<view class="my_xinshouxiadan_txt">{{ newuserprocess.fourth_remark }}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	// pages/shouye/shouye_zkc/shouye_zkc.js
	const app = getApp();

	let request = require("../../../utils/require");

	export default {
		data() {
			return {
				navH: app.globalData.navHeight,
				gaodu: app.globalData.height,
				gaodutops: app.globalData.top,
				imgUrl: app.globalData.imgUrl,
				cangkulist: [],
				dizhilist: "",
				province: "",
				city: "",
				region: "",
				newuserprocess:'',
			};
		},
		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad() {
			var that = this;
		},
		onShow() {
			var that = this;
			that.cangkulistFun();
			that.settingFun();
		},
		/**
		 * 生命周期函数--监听页面初次渲染完成
		 */
		onReady: function() {},
		/**
		 * 生命周期函数--监听页面隐藏
		 */
		onHide: function() {},
		/**
		 * 生命周期函数--监听页面卸载
		 */
		onUnload: function() {},
		/**
		 * 页面相关事件处理函数--监听用户下拉动作
		 */
		onPullDownRefresh: function() {},
		/**
		 * 页面上拉触底事件的处理函数
		 */
		onReachBottom: function() {},
		/**
		 * 用户点击右上角分享
		 */
		onShareAppMessage: function() {},
		methods: {
			//设置
			settingFun() {
				var that = this;
				var data = {
					token: uni.getStorageSync('token')
				};
				request.post(`index.php?s=/api/page/service&wxapp_id=` + uni.getStorageSync('web_id'), data).then(res => {
					if (res.data.code == 1) {
						that.newuserprocess= res.data.data.userclient.newuserprocess
						uni.setStorageSync('setting', res.data.data.values);
						uni.setStorageSync('paytype', res.data.data.paytype);
						uni.setStorageSync('copyright', res.data.data.copyright);
						uni.setStorageSync('userclient', res.data.data.userclient);
						uni.setStorageSync('weight_mode', res.data.data.values.weight_mode);
						uni.setStorageSync('price_mode', res.data.data.values.price_mode);
						uni.setStorageSync('appname', res.data.data.values.name);
						uni.setStorageSync('is_packagestation', res.data.data.values.is_packagestation);
						uni.setStorageSync('is_categorysearch', res.data.data.values.is_categorysearch);
						uni.setStorageSync('address_setting', res.data.data.values.address_setting);
						uni.setStorageSync('menu_type', res.data.data.values.menu_type);
					} else {
						uni.showToast({
							title: res.data.msg,
							icon: 'none'
						});
					}
				});
			},
			//跳转包裹预报
			tiaozhuans() {
				if(this.newuserprocess.second_tiaozhuantype==1){
					uni.navigateTo({
						url: this.newuserprocess.second_tiaozhuanurl,
					});
				}
				if(this.newuserprocess.second_tiaozhuantype==2){
					uni.navigateTo({
						url: '/pages/webview/webview?' + 'url=' + this.newuserprocess.second_tiaozhuanurl
					});
				}
			},

			//复制
			fuzhi: function(e) {
				var that = this;
				var index = e.currentTarget.dataset.id;
				var cangku = that.cangkulist[index];
				console.log(cangku, 553);
				var dizhilist =
					cangku.linkman +
					"," +
					cangku.phone +
					"," +
					cangku.region.province +
					cangku.region.city +
					cangku.region.region +
					cangku.address;

				uni.setClipboardData({
					data: dizhilist,
					success: function(res) {
						
						uni.getClipboardData({
							success: function(res) {
								console.log(res,9999)
								uni.showToast({
									title: "复制成功",
								});
							},
						});
					},
					fail: function(res) {
						console.log(res,999)
					}
				});
			},

			jumpzuo() {
				uni.navigateBack();
			},

			cangkulistFun() {
				var that = this;
				var data = {
					token: uni.getStorageSync("token"),
				};
				if(uni.getStorageSync("usermark")){
					data['usermark'] = uni.getStorageSync("usermark").mark;
				}
				request.get(`index.php?s=/api/page/storageList&wxapp_id=` +uni.getStorageSync("web_id"),data)
					.then((res) => {
						if (res.data.code == 1) {
							var cangkulist = res.data.data;
							that.cangkulist= res.data.data,
							console.log(res.data, "re?????");
						}
					});
			},
		},
	};
</script>
<style>
	@import "./my_xinshouxiadan.css";
</style>